Xbasic

*add_years Function

Syntax

dim newTime as T = *ADD_YEARS(time as T, years as N)

Arguments

timeTime

A time value.

yearsNumeric

The number of years to add to the time value. Years can be a negative value.

Returns

newTimeTime

Returns the time value incremented by years.

Description

Add years to date or time.

Example

dim time as t
time = now()
? time
= 10/12/2017 08:54:05 89 am

dim increment as n
increment = round(rand()*100,0)
? increment
= 29

? *add_years(time, increment)
= 10/12/2046 08:54:05 89 am

See Also